From: Tony Chen Date: Tue, 2 Jun 2026 20:16:49 +0000 (-0400) Subject: windowManager: Expose WorkspaceTracker blockUpdates & unblockUpdates X-Git-Tag: archive/raspbian/50.5-1+rpi1^2~14^2^2~11 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=ad781ad85d98686ea0e00595cb60e617b23bb625;p=gnome-shell.git windowManager: Expose WorkspaceTracker blockUpdates & unblockUpdates Update blocking is currently only used by the workspace switcher popup, but the workspace animation needs to do the same. To prepare for that, expose block workspace updates on WindowManager to make it available outside the module. Use a counter to track block/unblock calls and avoid contention over the _pauseWorkspaceCheck boolean inside WorkspaceTracker. Part-of: (cherry picked from commit 217b1502057a78b13a3a5dd73a8b202e81aec127) --- diff --git a/js/ui/windowManager.js b/js/ui/windowManager.js index 92d6cf8aa..fe824a1ed 100644 --- a/js/ui/windowManager.js +++ b/js/ui/windowManager.js @@ -512,6 +512,7 @@ export class WindowManager { this._isWorkspacePrepended = false; this._canScroll = true; // limiting scrolling speed + this._blockCount = 0; this._shellwm.connect('kill-window-effects', (shellwm, actor) => { this._minimizeWindowDone(shellwm, actor); @@ -1066,6 +1067,33 @@ export class WindowManager { this._workspaceTracker.keepWorkspaceAlive(workspace, duration); } + blockWorkspaceUpdates() { + if (++this._blockCount > 1) + return; + + if (!this._workspaceTracker) + return; + + this._workspaceTracker.blockUpdates(); + } + + unblockWorkspaceUpdates() { + console.assert(this._blockCount > 0, + 'Unmatched call to unblockWorkspaceUpdates()'); + if (this._blockCount === 0) + return; + + this._blockCount -= 1; + + if (this._blockCount !== 0) + return; + + if (!this._workspaceTracker) + return; + + this._workspaceTracker.unblockUpdates(); + } + skipNextEffect(actor) { this._skippedActors.add(actor); } @@ -1807,10 +1835,10 @@ export class WindowManager { if (!Main.overview.visible) { if (this._workspaceSwitcherPopup == null) { - this._workspaceTracker.blockUpdates(); + this.blockWorkspaceUpdates(); this._workspaceSwitcherPopup = new WorkspaceSwitcherPopup.WorkspaceSwitcherPopup(); this._workspaceSwitcherPopup.connect('destroy', () => { - this._workspaceTracker.unblockUpdates(); + this.unblockWorkspaceUpdates(); this._workspaceSwitcherPopup = null; this._isWorkspacePrepended = false; });